package com.osfw.framework.utils;


import eu.bitwalker.useragentutils.UserAgent;

public class UserAgentUtil {

    // 获取客户端操作系统
    public static String getOperatingSystem(){
        UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
        return userAgent.getOperatingSystem().getName();
    }

    // 获取客户端操作系统
    public static String getBrowser(){
        UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
        return userAgent.getBrowser().getName();
    }

}
